@extends('Home.price.layout')
@section('con')

    <!-- 分页样式 -->
    <style type="text/css">
    </style>

<div class="w clf">
    <div class="adArea">

    </div>
<div class="place">
    <span class="l g9">当前位置：</span> <a href="{{url('/home')}}">首页</a><em>></em>
    <a href="{{url('/home/price')}}">价格</a> <em>></em>
    产地价格
    <div class="tag">
        <span id="pztag" style="display:none" class="mr10">
            <em>品种：</em>
            <i id="lblCodex" codexid="0"></i>
            <s id="btnDelCodex"></s>
        </span>
        <span id="ystag" style="display:none">
            <em>区域：</em>
            <i id="lblPlace" placeid="0"></i>
            <s id="btnDelPlace"></s>
        </span>
        <span id="keytag" style="display:none">
            <em>关键字：</em>
            <i id="lblKey"></i>
            <s id="btnDelKeyword"></s>
        </span>
    </div>
</div>
    <!-- 搜索 -->
<div class="main">
    <div class="scbox">
        <div class="sccol">
            <div class="sct mt5">品种：</div>
            <div id="breedCons" class="breedCon scc">
                <div class="ovh py f14">
                    <div class="pyTop ovh">
                        @foreach($first as $k => $v)
                            <a href="javascript:void(0)">{{ucfirst($v -> first)}}</a>
                        @endforeach
                    </div>
                    <div class="pyCon ovh none" id="divMCodexSubLetters"></div>
                </div>
                <div class="secBreeds none" id="divPinyinMCodex"></div>
            </div>
        </div>
        
        <div id="provincesdiv" class="sccol">
                <div class="sct">区域：</div>
                <div class="scc qy" id="pro">
                @foreach($area as $k => $v)   
                    <a href="javascript:void(0);">{{$v}}</a>    
                @endforeach           
                    <i id="btnOpenClose">↓展开</i>
                </div>
            </div>
        
        <div class="sccol">
            <div class="sct">搜索：</div>
            <div class="scc">
                <input type="text" id="keyword" maxlength="7" name="keyword" class="sctxt" value=""><input type="button" id="sub_search" style="cursor:pointer" class="scbtn">
            </div>
        </div>
    </div>
    <!-- 内容 -->
    <div class="priceTableBox">
        <div class="priceTable">
            <div class="listTH">
                <div class="w1">品名</div>
                <div class="w2" onclick="ZYCLib.Price.Handdler.SortClick(11)"><div class="defalut"><a href="javascript:void 0;">规格</a> <i></i></div></div>
                <div class="w9" onclick="ZYCLib.Price.Handdler.SortClick(9)"><div class="defalut"><a href="javascript:void 0;">产地</a><i></i></div></div>
                <div class="w3" onclick="ZYCLib.Price.Handdler.SortClick(7)"><div class="defalut"><a href="javascript:void 0;">最新价格</a><i></i></div></div>
                <div class="w4">走势</div>                                                                                                                                                    
                <div class="w5" onclick="ZYCLib.Price.Handdler.SortClick(1)"><div class="defalut"><a href="javascript:void 0;">周涨跌</a><i></i></div></div>
                <div class="w6" onclick="ZYCLib.Price.Handdler.SortClick(3)"><div class="defalut"><a href="javascript:void 0;">月涨跌</a><i></i></div></div>
                <div class="w7" onclick="ZYCLib.Price.Handdler.SortClick(5)"><div class="defalut"><a href="javascript:void 0;">年涨跌</a><i></i></div></div>
                <div class="w8">价格图</div>
            </div>
            <ul class="priceTableRows">
                    @foreach($prices as $k => $v)
                        @if($k % 2 != 0)
                        <li class="cq">
                        @else
                        <li class="">
                        @endif
                            <span class="w1"><a href="{{url('/home/varieties/list',['name' => $v -> mName])}}" title="{{$v -> mName}}" target="_blank">{{$v -> mName}}</a></span>
                            <span class="w2"><a href="http://www.zyctd.com/jiage/xq354.html" title="全草" target="_blank">{{$v -> size}}</a></span>
                            <span class="w9" title="{{$v -> from}}">{{$v -> from}}</span>
                            <span class="w3">{{$v -> fromprice}}</span>
                            <span class="w4">{{$v -> trend}}</span>
                            <span class="w5"><em class="up">{{$v -> week}}</em></span>
                            <span class="w6"><em class="up">{{$v -> month}}</em></span>
                            <span class="w7"><em class="up">{{$v -> year}}</em></span>
                            <span class="w8"><a href="http://www.zyctd.com/jiage/xq354.html" title="{{$v -> mName}}" target="_blank"><img src="/bootcss/home/Picture/icon_chart.gif"></a></span>
                        </li>
                        <div style="display:none">{{$count++}}</div>
                        @if($count > 25)
                            <?php $count = 1;break; ?>
                        @endif
                    @endforeach
            </ul>
        </div>
    </div>
    <div class="page">
        <!-- <div class="pageBreak"><div class="pageWrap"><span class="canot">上一页</span></div><div class="pageWrap"><span class="now numBtn" href="/jiage/8-0-0-1.html" title="第1页">1</span></div> <div class="pageWrap"><a class="page numBtn" href="/jiage/8-0-0-2.html" title="第2页">2</a></div> <div class="pageWrap"><a class="page numBtn" href="/jiage/8-0-0-3.html" title="第3页">3</a></div> <div class="pageWrap"><a class="page numBtn" href="/jiage/8-0-0-4.html" title="第4页">4</a></div> <div class="pageWrap"><a class="page numBtn" href="/jiage/8-0-0-5.html" title="第5页">5</a></div> <div class="pageWrap"><span class="pageText">&hellip;</span></div> <div class="pageWrap"><a class="page numBtn" href="/jiage/8-0-0-75.html" title="第75页">75</a></div> <div class="pageWrap"><a class="page" href="/jiage/8-0-0-2.html">下一页</a></div><div class="pageWrap"><input type="text" subtype="int" class="pageNum" id="txtPagepageCute" /></div> <div class="pageWrap"><span class="pageText">页</span></div> <div class="pageWrap"><input type="button" class="pageBtn" value="转到" onclick="ZYCLib.Web.URL.GoToPage(75,'txtPagepageCute','/jiage/8-0-0-{0}.html');" /></div></div><div  id="ShowTippageCute" style=" clear:both; float: right;"></div> -->
        <div class="pageBreak">
            {!! $prices -> render() !!}
            <div id="ShowTippageCute" style=" clear:both; float: right;"></div>
        </div>
    </div>
</div>
<!-- 右侧内容 -->
<div class="sub">
    <div class="subbox mb30">
        <h2 class="tht"><strong>综合200月涨幅榜</strong></h2>
        <ul class="hotBreed changeBang pb10">
            <li class="hotBreedTh">
                <span class="w1">名称</span><span class="w2">规格</span><span class="w3">  市场</span><span class="w4">价格</span><span class="w5">涨幅</span>
            </li>
            @foreach($up as $k => $v)
                <li class="">
                    <span class="w1"><a href="{{url('/home/varieties/list',['name' => $v -> mName])}}" title="{{$v -> mName}}" target="_blank">{{$v -> mName}}</a></span>
                    <span class="w2">{{$v -> size}}</span>
                    <span class="w3" title="{{$v -> from}}">{{$v -> from}}</span>
                    <span class="w4" title="{{$v -> fromprice}}">{{$v -> fromprice}}</span>
                    <span class="w5 up" title="76%"><em class="up">{{$v -> year}}</em></span>
                </li>
            @endforeach
        </ul>
    </div>
    <div class="subbox mb30">
        <h2 class="tht"><strong>综合200月跌幅榜</strong></h2>
        <ul class="hotBreed changeBang pb10">
            <li class="hotBreedTh">
                <span class="w1">名称</span><span class="w2">规格</span><span class="w3">  市场</span><span class="w4">价格</span><span class="w5">跌幅</span>
            </li>
            @foreach($down as $k => $v)
                <li class="">
                    <span class="w1"><a href="{{url('/home/varieties/list',['name' => $v -> mName])}}" title="{{$v -> mName}}" target="_blank">{{$v -> mName}}</a></span>
                    <span class="w2">{{$v -> size}}</span>
                    <span class="w3" title="{{$v -> from}}">{{$v -> from}}</span>
                    <span class="w4" title="{{$v -> fromprice}}">{{$v -> fromprice}}</span>
                    <span class="w5 down" title="-23.08%"><em class="down">{{$v -> year}}</em></span>
                </li>
            @endforeach
        </ul>
    </div>
    <div class="subbox mb30">
        <h2 class="tht"><strong>热门资讯</strong></h2>
        <ul class="txtlist pb10">
                    <li><a href="http://www.zyctd.com/cunchu/259498.html">西洋参、冬虫夏草低温储存技术</a></li>
                    <li><a href="http://www.zyctd.com/zixun/201/259493.html">云南屏边县八角茴香价滑</a></li>
                    <li><a href="http://www.zyctd.com/zixun/202/259492.html">头条：阴雨连绵月余，野菊花产新严重受阻！</a></li>
                    <li><a href="http://www.zyctd.com/zixun/204/259491.html">《“健康中国2030”规划纲要》出台 快来看哪些与你相关</a></li>
                    <li><a href="http://www.zyctd.com/zixun/202/259490.html">聚焦：柴胡产新，种源混乱质量堪忧！</a></li>
                    <li><a href="http://www.zyctd.com/zixun/201/259489.html">山东省济宁市泗水县薄荷走动不错</a></li>
                    <li><a href="http://www.zyctd.com/zixun/204/259488.html">专家解读《“健康中国2030”规划纲要》</a></li>
                    <li><a href="http://www.zyctd.com/zixun/201/259487.html">新疆伊犁霍城县沙棘价稳</a></li>
        </ul>
    </div>
    <div class="subbox bnclr">
        <div class="adArea">
            



        </div>
    </div>
</div>
<div class="adArea mt20 mb30">

</div>
</div>

    
    <script type="text/javascript" src="/bootcss/home/Scripts/jquery-1.8.3.min.js"></script>
    <!-- 展开单击事件 -->
    <script>
        $("#btnOpenClose").click(function() {
            if ($(this).html() == '↓展开') { 
                $(this).html('↑收起'); 
                $('#pro').animate({ 'height': '150px' }, 200); 
            }else{ 
                $(this).html('↓展开'); 
                $('#pro').animate({ 'height': '20px' }, 200);
            }
        });
    </script>

    <!-- 首字母搜索js -->
    <script type="text/javascript">
        // alert($);
        $.ajaxSetup({
            headers:{
                'X-CSRF-TOKEN':$('meta[name="csrf-token"]').attr('content')
            }
        });
        // 首字母单击事件
        $(".pyTop a").click(function(){
            $(this).addClass('selected').siblings().removeClass('selected');
            $(".py .pyCon").css('display','block');
            $(".secBreeds").css('display','block');
            // 获取首字母
            var py = $(this).html();
            //首字母ajax返回数据
            $.ajax({
                url: '/home/varieties/ajax',
                type: 'post',
                dataType: 'json',
                data: {"pinyin":py},
                success:function(data){
                    // console.log(data);
                    var html = "<a class='selected' sign='subletter' href='javascript:void(0)'>"+py+"</a>";
                    var alln = ""; 
                    for(var i = 0;i<data.length;i++){
                        if(i == 0){
                            for(var j = 0;j<data[i].length;j++){
                                html += "<a class='pinyin' sign='subletter' href='javascript:void(0)'>"+data[i][j].pinyin+"</a>";
                            }
                        }else if(i == 1){
                            for(var j = 0;j<data[i].length;j++){
                                alln += "<a class='name' href='javascript:void(0)'>"+data[i][j].name+"</a>"; 
                            }
                        }
                    }
                    $(".py .pyCon").html('').append(html);
                    $(".py").next(".secBreeds").html('').append(alln);
                },
                error:function(data){

                },
                timeout:2000,
                async:true
            });

        });
    </script>

    <!-- 品种缩写js -->
    <script type="text/javascript">
        $(".pyCon .pinyin").live('click',function(){
            var pinyin = $(this).html();
            // alert(pinyin);
            $.ajax({
                url: '/home/varieties/name',
                type: 'post',
                dataType: 'json',
                data: {"name":pinyin},
                success:function(data){
                    // alert('ddd');
                    var alln = ""; 
                    for(var i = 0;i<data.length;i++){
                        alln += "<a class='name' href='javascript:void(0)'>"+data[i].name+"</a>"; 
                    }
                    $(".py").next(".secBreeds").html('').append(alln);
                },
                error:function(data){
                    // alert('dd');
                },
                timeout:2000,
                async:true
            })
        });
    </script>
    
    <!-- 品种名单击事件js -->
    <script type="text/javascript">
        $(".secBreeds .name").live('click',function(){
            // alert('111')
            var name = $(this).html();
            $(".tag #pztag").css('display','block').find('#lblCodex').html(name);

            //ajax请求
            $.ajax({
                url:'/home/price/ajax',
                type:'post',
                dataType:'json',
                data:{"name":name},
                success:function(data){
                    // console.log(data);
                    var info = '';
                    for(var i = 0;i<data.length;i++){
                        if(i == 0){
                            for(var j = 0;j<data[i].length;j++){
                                if(j % 2 != 0){
                                    info += '<li class="cq">';
                                }else{
                                    info += '<li class="">';
                                }
                                    info += '<span class="w1"><a href="" title="'+data[i].mName+'" target="_blank">'+data[i][j].mName+'</a></span>';
                                    info += '<span class="w2"><a href="http://www.zyctd.com/jiage/xq354.html" title="'+data[i][j].size+'" target="_blank">'+data[i][j].size+'</a></span>';
                                    info += '<span class="w9" title="'+data[i][j].from+'">'+data[i][j].from+'</span>';
                                    info += '<span class="w3">'+data[i][j].fromprice+'</span>';
                                    info += '<span class="w4">'+data[i][j].trend+'</span>';
                                    info += '<span class="w5"><em class="up">'+data[i][j].week+'</em></span>';
                                    info += '<span class="w6"><em class="up">'+data[i][j].month+'</em></span>';
                                    info += '<span class="w7"><em class="up">'+data[i][j].year+'</em></span>';
                                    info += '<span class="w8"><a href="http://www.zyctd.com/jiage/xq354.html" title="'+data[i][j].mNam+'" target="_blank"><img src="/bootcss/home/Picture/icon_chart.gif"></a></span>';
                            }
                        }
                    }
                    $(".priceTableRows").html('').append(info);
                },
                error:function(data){

                },
                timeout:2000,
                async:true
            })
        });

        $(".tag #pztag").find('s').live('click',function(){
            $(this).parent('#pztag').css('display','none');
        });
    </script>

    <!-- 地区单击事件js -->
    <script type="text/javascript">
        $(".qy a").live('click',function(){
            var area = $(this).html();
            $(".tag #ystag").css('display','block').find('#lblPlace').html(area);

            //发送ajax请求
            $.ajax({
                url:'/home/price/ajax',
                type:'post',
                dataType:'json',
                data:{"area":area},
                success:function(data){
                    var info = '';
                    for(var i = 0;i<data.length;i++){
                        if(i == 2){
                            for(var j = 0;j<data[i].length;j++){
                                if(j % 2 != 0){
                                    info += '<li class="cq">';
                                }else{
                                    info += '<li class="">';
                                }
                                    info += '<span class="w1"><a href="" title="'+data[i][j].mName+'" target="_blank">'+data[i][j].mName+'</a></span>';
                                    info += '<span class="w2"><a href="http://www.zyctd.com/jiage/xq354.html" title="'+data[i][j].size+'" target="_blank">'+data[i][j].size+'</a></span>';
                                    info += '<span class="w9" title="'+data[i][j].from+'">'+data[i][j].from+'</span>';
                                    info += '<span class="w3">'+data[i][j].fromprice+'</span>';
                                    info += '<span class="w4">'+data[i][j].trend+'</span>';
                                    info += '<span class="w5"><em class="up">'+data[i][j].week+'</em></span>';
                                    info += '<span class="w6"><em class="up">'+data[i][j].month+'</em></span>';
                                    info += '<span class="w7"><em class="up">'+data[i][j].year+'</em></span>';
                                    info += '<span class="w8"><a href="http://www.zyctd.com/jiage/xq354.html" title="'+data[i][j].mNam+'" target="_blank"><img src="/bootcss/home/Picture/icon_chart.gif"></a></span>';
                            }
                        }
                    }
                    $(".priceTableRows").html('').append(info);
                },
                error:function(data){

                },
                timeout:2000,
                async:true 
            })
        });

        $("#btnDelPlace").click(function(){
            $(this).parent('#ystag').css('display','none');

        });
    </script>
  
    <!-- 分页样式 -->
<!--
    <script type="text/javascript">
        console.log($(".pageBreak ul").find('li').html());
        var ul = $(".pageBreak ul").html();
        for(var i=0;i<ul.length;i++){
            $('<div class="pageWrap">'+ul[i].li+'</div>')
        }

    </script>
-->
@endsection